<template>
  <div
    class="permissionmanage-detail-base"
    style="position: absolute; top: 0; left: 0; display: flex; width: 100%; height: 100%"
  >
    <div style="width: 196px; height: 100%; color: white; background-color: #222834">
      <a-page-header title="返回权限管理" @back="cancal" />
    </div>
    <div style="width: calc(100% - 196px)">
      <div class="perm-detail">
        <div class="content">
          <div class="content-body">
            <div class="title">{{ currentItem.name }}</div>
            <a-tabs v-model:activeKey="activeKey">
              <a-tab-pane key="1" tab="基本信息">
                <detailaInfo @update-success="updateSuccess"></detailaInfo>
              </a-tab-pane>
              <a-tab-pane key="2" tab="关联角色">
                <detailbRole></detailbRole>
              </a-tab-pane>
            </a-tabs>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, reactive, inject, defineEmits, onMounted } from 'vue'
import { ArrowLeftOutlined } from '@ant-design/icons-vue'
import detailaInfo from './detailaInfo'
import detailbRole from './detailbRole'

let menu = document.getElementById('indexlayout-left')
let menutop = document.getElementById('indexlayout-right-top')

onMounted(() => {
  menu.style.display = 'none'
  menutop.style.display = 'none'
})

const { currentItemId: currentItem, upperRol } = inject('roleParams')
const activeKey = ref('1')
const emit = defineEmits(['close-edit', 'update-success'])
const cancal = () => {
  menu.style.display = 'initial'
  menutop.style.display = 'initial'
  emit('close-edit', false)
}
const updateSuccess = (modelRef) => {
  emit('update-success', modelRef)
}
</script>

<style lang="less" scoped>
.perm-detail {
  display: flex;
  width: 100%;
  //position: absolute;
  //top: 0px;
  //left: 0px;
  height: 100%;
  padding: 15px;
  background-color: white;

  .content {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    padding: 5px 15px;
    background-color: white;

    .content-body {
      height: calc(100% - 17px);

      .title {
        font-weight: bolder;
        font-size: 28px;
      }
    }
  }
}

:deep(.ant-page-header-back-button) {
  color: #fff;
}

:deep(.ant-page-header-heading-title) {
  color: #fff;
  font-size: 16px;
}
</style>
<style lang="less">
.perm-detail {
  .ant-tabs {
    height: auto !important;

    .ant-tabs-content {
      height: auto !important;
    }
  }
}
</style>
